<script type="text/javascript">
<!--

//-->
function open_box()
{
	$('.function_box').fadeIn();
}

function close_box()
{
	$('.function_box').fadeOut();
}
function change_status()
{
		var form_data={'id':$('#this_id').val(),'status':$('#this_value').val() }
		console.log(form_data);
		$.ajax({
			url:'<?=site_url("admin990/members/status")?>',
			type:'POST',
			async:false,
			data:form_data,
			dataType:'json',
			success:function(m){
					close_box();
					location.reload();
				}
			});
			

			
	}
</script>
<div class="function_box" style="display:none;">
<div class="change_status">
<form actions="#" method="post">
<label>état options:</label>
<select id="this_value" name="status">
<option value="active" <?php if($this_member->status=='active'){echo 'selected="selected"';}?>>activé</option>
<option value="null" <?php if($this_member->status==null){echo 'selected="selected"';}?>>non activé</option>

</select>
<input type="hidden" id="this_id" name="id" value="<?=$this_member->id?>">
<input type="button" value="submit" onclick="change_status()">
</form>
</div>
<div class="function_box_bg" onclick="close_box();"></div>

</div>
<div class="body">
<table cellpadding="6" cellspacing="1" style="width:750px" border="0" align="center">
<tr style="background: skyBlue;">
<td>Client</td>
<td>L'état du compte</td>
<td>Téléphone</td>
<td>Email</td>
</tr>
<tr>
<td><?=$this_member->firstname?>&nbsp;<?=$this_member->lastname?></td>
<td><?php if($this_member->status=='active'){?><img src="<?=base_url()?>/resources/imgs/block_yes.png" height="15" alt="activé" title="activé"> activé<?php }else{?><img src="<?=base_url()?>/resources/imgs/block_no.png" height="15" alt="non activé" title="non activé"> non activé<?php }?> | <a href="javascrsipt:void(0)" onclick="open_box()"><img src="<?=base_url('resources/imgs/edit.png')?>" width="15">editer</a></td>
<td><?=$this_member->tel?></td>
<td><?=$this_member->email?></td>
</tr>
<tr style="background: skyBlue;">
<td>ID</td>
<td>Numéro de commande</td>
<td>Détaille</td>
<td>L'heure de commande</td>
<td>Réduction</td>
<td>Supplément</td>
<td>Total €</td> 
<td style="background:white;"><a href="<?=site_url('admin990/members')?>/<?=$_GET['per_page']?>">retour</a></td>
</tr>
<?php if($orders){?>


<?php foreach ($orders as $o):?>
<tr>
<td><?=$o->id?></td>
<td><?=$o->order_num?></td>
<td><a href="<?=site_url('admin990/orders/detail').'/'.$o->order_time->format('Y/m/d').'/'.$o->order_num.'?per_page='.$_GET['per_page'].'&member_id='.$o->member_id;?>">- voir -</a></td>
<td><?=$o->order_time?></td>
<td><?=$o->discount*100?>%</td>
<td><?if($o->extra != NULL){?><?=$o->extra?> €<?php }else{?>-  -  -<?php }?></td>
<td><?=$o->total*(1-$o->discount)+$o->extra?>&nbsp;€</td>

</tr>
<?php endforeach;?>

</table>
<hr>
<?php }else{echo "<tr><td>Il n'y a pas de commande..</td></tr>";}?>
</div>